type Flatten<T extends any[]> = T extends [infer R, ...infer P] ? R extends any[] ? Flatten<[...R, ...P]> : [R, ...Flatten<P>] : []